//
//  MineCouponsMpdel.swift
//  LeTu
//
//  Created by g1 on 2023/12/11.
//

import Foundation

class MineCouponsModel: Mappable {
    
    var createTime = ""
    /// 有效期多少天, 0代表永远有效
    var durationDay = 365
    var endDate = ""
    var id = -1
    var money = 0
    /// 优惠券名称
    var name = ""
    var couponName = ""
    var received = 0
    var remarks = ""
    var startDate = ""
    /// 0: 已上架 1：已下架
    var status = 0
    /// 有效期类型（0：固定起止日期 1：固定有效期时长
    var type = 1
    var updateTime = ""
    var useBrief = ""
    var useDate = ""
    /// '0:未使用 1:已使用 2:已过期'
    var useStatus = 0
    
    init() {
        
    }
    
    required init?(map: ObjectMapper.Map) {
        
    }
    
    func mapping(map: ObjectMapper.Map) {
        
        createTime <- map["createTime"]
        durationDay <- map["durationDay"]
        endDate <- map["endDate"]
        id <- map["id"]
        money <- map["money"]
        name <- map["name"]
        couponName <- map["couponName"]
        received <- map["received"]
        remarks <- map["remarks"]
        startDate <- map["startDate"]
        status <- map["status"]
        type <- map["type"]
        updateTime <- map["updateTime"]
        useBrief <- map["useBrief"]
        useDate <- map["useDate"]
        useStatus <- map["useStatus"]
        
        guard name.count == 0 && couponName.count > 0 else { return }
        name = couponName
        
    }
 
}

